﻿@{
    Layout = null;
    ViewBag.Title = "Home Page";
}
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>物流管理系统后台</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="~/Content/font.css">
    <link rel="stylesheet" href="~/Content/framemain.css">
    <link rel="stylesheet" href="~/Content/theme6.css">
    <link rel="icon" sizes="any" mask="" href="~/images/titlelogo.png">
    <link rel="shortcut icon" href="~/images/titlelogo.png" type="image/x-icon">
    <script src="~/Content/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="~/Scripts/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="~/Scripts/framemain.js"></script>
    <script type="text/javascript" src="~/Scripts/layindex.js"></script>
    <script src="~/Scripts/jquery.min.js"></script>
    <script src="~/Scripts/index.js"></script>
    <script src="~/Scripts/index -1.js"></script>
    <style>
        #FontScroll {
            max-width: 600px !important;
            height: 160px;
            overflow: hidden;
        }

            #FontScroll ul li {
                height: 32px;
                max-width: 600px !important;
                color: #ffffff;
                line-height: 32px;
                font-size: 14px;
                overflow: hidden;
            }

                #FontScroll ul li i {
                    color: red;
                }

        .layui-table td, .layui-table th {
            min-width: auto !important;
        }
        th {
            width: 65px;
            text-align: center;
            background-color: #f2f2f2;
        }
        .marquee {
            float: left;
            text-align: center;
            width: 60%;
            margin-left: 20px;
            height: 45px;
            line-height: 45px;
            color: #fff;
        }
        .marquee span {
            font-size: 20px;
            font-family: 隶书;
            font-weight:800;
        }
        marquee {
            white-space: nowrap;
            overflow: hidden;
            width: 100%;
        }
        .span-text {
            margin-right: 50px;
        }
        .span-xin {
            color: red;
        }
        .span-col {
            color: #f5f51e;
        }
        .layui-layer-tips i.layui-layer-TipsB, .layui-layer-tips i.layui-layer-TipsT {
            left:80px !important;
        }
    </style>
    <script type="text/javascript">
        // 是否开启刷新记忆tab功能
        var is_remember = false;
        $(function () {
           
        })
    </script>
</head>
<body class="index">
    <form id="form1" class="layui-form" runat="server">
        <!-- 顶部开始 -->
        <div class="container">
            <div class="logo">
                <a href="#"> <img src="~/images/logo.png" width="40" style="margin-top:-5px;" />物流管理系统后台</a>
            </div>
            <div class="left_open">
                <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
            </div>
            <div class="marquee">
                <marquee onmouseover="this.stop()" onmouseout="this.start()">
                    @{
                        foreach (DeliveryManage.Model.Pro_Orders item in ViewBag.OrdersList)
                        {
                            if (MvcApplication.UserList.ContainsKey(item.EmployeeId))
                            {
                                if (item.TotalAmount > 19)
                                {
                                    <span class="span-xin">❤</span><span class="span-text"> 恭喜【@MvcApplication.UserList[item.EmployeeId].Nickname】喜提订单，金额： <span class="span-col">@item.TotalAmount 元</span> !</span>
                                }
                                else
                                {
                                    <span class="span-xin">❤</span><span class="span-text"> 恭喜【@MvcApplication.UserList[item.EmployeeId].Nickname】送酒一次 !</span>
                                }

                            }
                        }
                    }
                </marquee>
            </div>
            <ul class="layui-nav right" lay-filter="" id="rightTop">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <i class="iconfont layui-icon layui-icon-username"></i>
                        <label>@ViewBag.UserName</label>
                    </a>
                    <dl class="layui-nav-child">
                        <!-- 二级菜单 -->
                        <dd><a onclick="xadmin.open('修改密码','/Home/PwdEdit',480,350)" href="javascript:;">修改密码</a></dd>
                        <dd><a onclick="xadmin.open('邮件提醒设置','/Home/EmailEdit',480,300)" href="javascript:;">邮件提醒设置</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item to-index">
                    <a href="/">退出登录</a>
                </li>
            </ul>
        </div>
        <!-- 顶部结束 -->
        <!-- 中部开始 -->
        <!-- 左侧菜单开始 -->
        <div class="left-nav">
            <div id="side-nav">
                <ul id="nav"></ul>
            </div>
        </div>
        <!-- <div class="x-slide_left"></div> -->
        <!-- 左侧菜单结束 -->
        <!-- 右侧主体开始 -->
        <div class="page-content">
            <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
                <ul class="layui-tab-title">
                    <li class="home layui-this">
                        <i class="layui-icon ">&#xe68e;</i>我的桌面
                    </li>
                </ul>
                <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
                    <dl>
                        <dd data-type="this">关闭当前</dd>
                        <dd data-type="other">关闭其它</dd>
                        <dd data-type="all">关闭全部</dd>
                    </dl>
                </div>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <iframe src='/Home/HomePage' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
                    </div>
                </div>
                <div id="tab_show"></div>
            </div>
        </div>
        <div class="page-content-bg"></div>
        <style id="theme_style"></style>
        <!-- 右侧主体结束 -->
        <!-- 中部结束 -->
    </form>
    <script type="text/javascript">
        $(function () {
            $('.myscroll').myScroll({
                speed: 60, //数值越大，速度越慢
                rowHeight: 30 //li的高度
            });
           
            // 页面加载完成后执行
            layui.use(['layer'], function () {
                var layer = layui.layer;
                
                // 每隔一分钟（5000毫秒）发送一次请求
                setInterval(function () {
                    $.ajax({
                        type: "POST",
                        url: "/Home/PostNewOrderMessage",
                        success: function (obj) {
                            if (obj.status == true) {
                                // 打开弹窗
                                console.log(obj.data)
                                _htmlstr(obj.data);
                            } else {
                                layer.close();
                            }
                        }
                    })
                }, 2000);

                function _htmlstr(data) {
                    var htmlstr = (`<div style='color:#666;'>
                                <h3><i class="layui-icon" style='font-size: 18px;'>&#xe645;</i>最新开单喜讯</h3>
                                <hr>
                                <p>开单人：<span style='font-size: 15px;'><b>${data.CustomerName}</b></span></p>
                                <p >开单金额：<span  style='color:red;font-size: 15px;'><b>${data.TotalAmount} 元</b></span></p>
                                </div>`);

                    // 弹窗的配置项
                    var options = {
                        tips: [1, '#fff'],
                        area: ['200px', '100px'],
                        time: 10000,//10秒后自动关闭弹窗
                        maxWidth: 500
                    }
                    // 打开弹窗
                    layer.tips(htmlstr, '#rightTop', options);
                }
            });
        });
    </script>
    <script src="~/Scripts/fontscroll.js"></script>
</body>

</html>
